package com.cssw.fyzb.job.executor.handler;

import com.cssw.fyzb.job.executor.service.task.TaskService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author
 */
@Component
public class TaskJob extends IJobHandler {

    @Autowired
    private TaskService taskService;

    private static final Logger logger = LoggerFactory.getLogger(TaskJob.class);

    @XxlJob("taskJob")
    @Override
    public ReturnT<String> execute(String param) throws Exception {
//        try {
//            logger.info("Start task calculation: {} ");
//            taskService.updateTask();
//            logger.info("Finish task calculation: {} ");
//            return ReturnT.SUCCESS;
//        } catch (Exception e) {
//            logger.debug("", e);
//            return ReturnT.FAIL;
//        }
        return null;
    }
}
